Subject: Re: Armageddon in E!
From: [email-masked]
To: [email-masked]
Date: Sat, 24 Jul 93 14:39:00 BST

Reply:  Item #4395553 from [email-masked]@INET#
 
Here is a little goodie that someone posted in the
AmigaNet:Programming conference.  I am not sure if it has been posted
here yet, but it works well some here it is:
 
MODULE 'dos/dos'
 
PROC readStr(handle, buffer)
  DEF bytes, size, eof=FALSE
  bytes:=Read(handle, buffer, StrMax(buffer))
  size:=bytes
  IF InStr(buffer, '\n', 0) > -1
    Seek(handle, -(bytes - InStr(buffer, '\n', 0)-1), OFFSET_CURRENT)
    bytes:=InStr(buffer, '\n', 0)
  ELSE
    IF size < StrMax(buffer) THEN eof:=TRUE
  ENDIF
  buffer[bytes]:=0
ENDPROC eof
 
This is a replacement for v2.1b's ReadStr() function.  This one is
generally 4 to 8 times faster and functions identically to E's.
 
Check it out.
 
BEANMAN...